﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/UserMaster.master"
    Inherits="System.Web.Mvc.ViewPage<IPagedList<Eacademy.Domain.Models.MessageViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Messages
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="message-container">
        <tr>
            <td class="chk-col">
                <input type="checkbox" name="select-all" />
            </td>
            <td class="img-col">
                <input type="button" class="button-style" value="delete" />
            </td>
            <td colspan="3">
                <input type="button" value="create new" onclick="window.open('/student/messages/create','_self');"
                    class="button-style" />
            </td>
        </tr>
        <%
            if (Model.Count < 1)
            {
                Response.Write("No Messages");
            }
        %>
        <%
            foreach (MessageViewModel message in Model)
            {
        %>
        <tr>
            <td class="chk-col">
                <input type="checkbox" name="select-message" />
            </td>
            <td class="img-col">
                <img src="/content/images/default_avatar.jpg" width="50" height="50" />
            </td>
            <td class="from-col">
                <span class="from-msg">
                    <%=message.NameOfSender %></span> <span class="date-msg">
                        <%=message.DateSent.ToShortDateString() %></span>
            </td>
            <td class="msg-col">
                <span class="subject-msg"> <a href="<%=Url.Action("Details",new{id = message.ConversationId}) %>">
                    <%=message.Subject %>
                </a></span><span class="clip-msg">
                    <%=message.Message.Truncate(50) %></span>
            </td>
            <td>
                <img src="/content/images/cancel.png" />
            </td>
        </tr>
        <%
            }
        %>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
